<?php
/*****************************************************************************
*
*	copyright(c) - sitemile.com - PricerrTheme
*	More Info: http://sitemile.com/p/pricerr
*	Coder: Saioc Dragos Andrei
*	Email: andreisaioc@gmail.com
*
******************************************************************************/

get_header();


?>
<!-- SpW: Move the serach box code from the original header.php -->	
<div class="search_box_main">
<?php
		global $wp_query;
		$query_vars = $wp_query->query_vars;
		
		$job_category = $query_vars['job_category'];
		if(empty($job_category)) $job_category = "all";  
		$job_sort = $query_vars['job_sort'];
		$job_tax = $query_vars['job_tax'];
		
		if(empty($job_category)) $job_category 	= "all";
		if(empty($page)) $page	= "1";
		if(empty($job_sort)) $job_sort = "auto";
		if(empty($job_tax)) $job_tax = "category";
 		
		$term_search = $query_vars['term_search']; 
		global $default_search;  
?>
        
<div id="suggest" >
	<form method="get" action="<?php bloginfo('siteurl');?>"> 
		<input type="hidden" value="1" name="search_me_now" />
		<input type="text" onfocus="this.value=''" id="big-search" name="term" autocomplete="off" onkeyup="suggest(this.value);" value="<?php if(!empty($term_search)) echo htmlspecialchars($term_search); 
		else echo $default_search; ?>" />								
		<input type="submit" id="big-search-submit" name="search_me" value="<?php _e("Search","theTheme"); ?>" />  
	</form>
	<div class="suggestionsBox" id="suggestions" style="z-index:999;display: none;"> <img src="<?php echo get_bloginfo('template_url');?>/images/arrow.png" style="position: relative; top: -12px; left: 30px;" alt="upArrow" />
		<div class="suggestionList" id="suggestionsList"> &nbsp; </div>
	</div>
</div>
</div>
	
	
<?php	
		$PricerrTheme_adv_code_home_above_content = stripslashes(get_option('PricerrTheme_adv_code_home_above_content'));
		if(!empty($PricerrTheme_adv_code_home_above_content)):
		
			echo '<div class="full_width_a_div">';
			echo stripslashes($PricerrTheme_adv_code_home_above_content);
			echo '</div>';
		
		endif;
	
?>
   
<!-- SpW ends Move the serach box -->    

        
        <?php		
		$PricerrTheme_home_page_layout = get_option('PricerrTheme_home_page_layout');		
		if($PricerrTheme_home_page_layout == "3" or $PricerrTheme_home_page_layout == "4" ):
			    echo '<div id="left-sidebar">';
					echo '<ul class="xoxo">';
				 		dynamic_sidebar( 'home-left-widget-area' ); 
					echo '</ul>';
				   echo '</div>';		
		endif;		
		?>
        
    <div id="content">    
	<!--SpW: remove the ugly banner -->
	<ul class="xoxo">
    <?php
		dynamic_sidebar( 'main-page-widget-area' );
	?>
	<li class="widget-container i-will-widget">

		<form method="post" action="<?php echo get_bloginfo('siteurl'); ?>/?posting_new=1">

		<?php _e("尋","PricerrTheme"); ?>: <input type="text" class="i_will_mainbox" name="i_will" /> 

		<?php _e("HK","PricerrTheme"); ?> 

		<?php  $PricerrTheme_enable_dropdown_values = get_option('PricerrTheme_enable_dropdown_values');
			   $PricerrTheme_enable_free_input_box = get_option('PricerrTheme_enable_free_input_box');
					
					if($PricerrTheme_enable_free_input_box == "yes")
					{
						if(PricerrTheme_show_price_in_front() == true)
						echo PricerrTheme_get_currency();
							
						echo ' <input type="text" name="job_cost" class="do_input" value="'.$_SESSION['job_cost'].'" size="5" /> ';
						
						if(PricerrTheme_show_price_in_front() == false)
						echo PricerrTheme_get_currency();
						
					}
					elseif($PricerrTheme_enable_dropdown_values == "yes")
					echo PricerrTheme_get_variale_cost_dropdown('do_input', $_SESSION['job_cost']);
					else                
					echo PricerrTheme_get_show_price(get_option('PricerrTheme_job_fixed_amount'));
		 ?>
<!-- when submitted store the session_i_will through functions -->
<input type="submit" value="<?php _e("Create new request","PricerrTheme"); ?>" name="submit_prepare_continue" class="i_will_continue" />
</form>
		
</li> 
        <li class="widget-container latest-posted-jobs-big">
        
        <?php include 'latest-jobs.php'; ?>
        
        </li>

		
		
		
	</ul>

	<!-- ##### -->
	</div>

	<?php if($PricerrTheme_home_page_layout != "5" && $PricerrTheme_home_page_layout != "4"): ?>
	
    <div id="right-sidebar">
		<ul class="xoxo">
	 <?php dynamic_sidebar( 'home-right-widget-area' ); ?>
		</ul>
       </div>

	<?php endif; ?>
    
    
    <?php
	
		if($PricerrTheme_home_page_layout == "2" ):
			
			    echo '<div id="left-sidebar">';
					echo '<ul class="xoxo">';
				 		dynamic_sidebar( 'home-left-widget-area' ); 
					echo '</ul>';
				   echo '</div>';
		
		endif;
		
	
	?>
    

<?php
	get_footer();
?>